package com.tcd.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 权限表
 * </p>
 *
 * @author space
 * @since 2021-05-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Permission对象", description="权限表")
public class Permission implements Serializable {

    @ApiModelProperty(value = "权限编号")
      @TableId(value = "permission_id", type = IdType.AUTO)
    private Integer permissionId;

    @ApiModelProperty(value = "权限名称")
    private String permissionName;

    @ApiModelProperty(value = "权限路径")
    private String permissionUrl;

    @ApiModelProperty(value = "父权限编号")
    private Integer parentId;

    @ApiModelProperty(value = "权限等级")
    private Integer permissionLevel;

    @ApiModelProperty(value = "图标")
    private String icon;

    @ApiModelProperty(value = "状态（禁用、启用）")
    private Boolean state;

    @ApiModelProperty(value = "排序编号")
    private Integer sortNumber;

    @ApiModelProperty(value = "说明")
    private String description;

    @ApiModelProperty(value = "创建时间")
      @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
      @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "逻辑删除")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "父权限")
    @TableField(exist = false)
    private Permission parent;

    @ApiModelProperty(value = "子权限集合")
    @TableField(exist = false)
    private List<Permission> children = new ArrayList<>();


}
